/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tkatva.soalog.SoalogEjb.entities;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author tuomas
 */
@Entity
@Table(name = "interface_user_groups")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "InterfaceUserGroups.findAll", query = "SELECT i FROM InterfaceUserGroups i")})
public class InterfaceUserGroups implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "user_group_interface_id")
    private Integer userGroupInterfaceId;
    @JoinColumn(name = "log_interface_id", referencedColumnName = "log_interface_id")
    @ManyToOne(optional = false)
    private LogInterface logInterfaceId;
    @JoinColumn(name = "user_group_id", referencedColumnName = "user_group_id")
    @ManyToOne(optional = false)
    private UserGroup userGroupId;

    public InterfaceUserGroups() {
    }

    public InterfaceUserGroups(Integer userGroupInterfaceId) {
        this.userGroupInterfaceId = userGroupInterfaceId;
    }

    public Integer getUserGroupInterfaceId() {
        return userGroupInterfaceId;
    }

    public void setUserGroupInterfaceId(Integer userGroupInterfaceId) {
        this.userGroupInterfaceId = userGroupInterfaceId;
    }

    public LogInterface getLogInterfaceId() {
        return logInterfaceId;
    }

    public void setLogInterfaceId(LogInterface logInterfaceId) {
        this.logInterfaceId = logInterfaceId;
    }

    public UserGroup getUserGroupId() {
        return userGroupId;
    }

    public void setUserGroupId(UserGroup userGroupId) {
        this.userGroupId = userGroupId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (userGroupInterfaceId != null ? userGroupInterfaceId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InterfaceUserGroups)) {
            return false;
        }
        InterfaceUserGroups other = (InterfaceUserGroups) object;
        if ((this.userGroupInterfaceId == null && other.userGroupInterfaceId != null) || (this.userGroupInterfaceId != null && !this.userGroupInterfaceId.equals(other.userGroupInterfaceId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tkatva.soalog.SoalogEjb.entities.InterfaceUserGroups[ userGroupInterfaceId=" + userGroupInterfaceId + " ]";
    }
    
}
